//装饰模式则是动态将功能附加到对象上，在对象功能扩展方面，它比继承更有弹性



class Cricle{
    draw(){
        console.log('绘制一个圆');
        
    }
}

class Decorator{
    constructor(){
        this.cricle = new Cricle()
    }
    draw(){
        this.cricle.draw()
        this.setBorderColor()
    }
    setBorderColor(){
        console.log('设置圆的边框颜色');
        
    }
}



// 测试用例
var c = new Cricle()
c.draw()
console.log('——————————————————');

var d = new Decorator()
d.draw()


